/**
 * 
 */
package com.ls.lserp.modules.custom.dao;

import com.ls.lserp.common.persistence.CrudDao;
import com.ls.lserp.common.persistence.annotation.MyBatisDao;
import com.ls.lserp.modules.common.entity.UploadFile;
import  com.ls.lserp.modules.order.entity.DesignOption;

import java.util.List;

/**
 * 款式设计DAO接口
 * @author zq
 * @version 2016-10-25
 */
@MyBatisDao
public interface CustomDao extends CrudDao<DesignOption> {

    /**
     * 查询款式子项
     * @param entity
     * @return
     */
    public List<DesignOption> findSubList(DesignOption designOption);

    /**
     * 查询子项图片返回fileId
     * 
     */
    public List<DesignOption>searchFileId(DesignOption designOption);
    
    
    /**
     * 根据itemCD查询父项是否已经存在
     * @param designOption
     * @return
     */
    public DesignOption searchDesginOptionInfoByItemCD(String itemCD);
    
    /**
     * 根据itemvalue查询父项是否已经存在
     * @param designOption
     * @return
     */
    public DesignOption searchDesginOptionInfoByItemValue(String itemValue);

    /**
     * 保存新款式
     * @param designerOption
     * @return
     */
    public int saveDesignOptionSub(DesignOption designOption);

    /**
     * 保存款式子项图片
     * @param designerOption
     * @return
     */
    public int saveUploadFile(UploadFile uploadFile);

    /**
     * 删除款式（逻辑删除）
     * @param designerOption
     * @return
     */
    public int deleteDesignOption(DesignOption designOption);

    /**
     * 删除款式（逻辑删除）
     * @param designerOption
     * @return
     */
    public int deleteSub(DesignOption designOption);
    
    /**
      * @Title: logicDeleteSub
      * @Description: 删除款式子项（逻辑删除）
      * @param @param designOption
      * @param @return
      * @return int 
      * @throws
      */
    
    public int logicDeleteSub(DesignOption designOption);
    /**
     * 更新子项
     */
    public int updateItems(DesignOption designOption);


	/**
	 * 查询需要导出的数据
	 * @param designOption
	 * @return
	 */
	public List<DesignOption> findAllListExport(DesignOption designOption);
	
	/**删除所有数据
	 * 
	 * @param designOption
	 * @return
	 */
	public int deleteAll(DesignOption designOption);

    /**判断数据存在与否
     *
     * @param id
     * @return
     */
    public int getCount(long id);

    /**
     * 更新子项数据
     * @param designOption
     * @return
     */
    public int updateSubItem(DesignOption designOption);
}
